package cn.net.cfss.fgbp.api.console.inte;

import cn.net.cfss.fgbp.api.console.constant.Constants;
import cn.net.cfss.fgbp.api.console.dto.SysMenuDto;
import cn.net.cfss.fgbp.api.console.vo.SysMenuVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = Constants.SPI_SERVER_NAME)
@RequestMapping("menu")
public interface ISysMenuService {

    @RequestMapping(value = "/add" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean insert(@RequestBody SysMenuVo menu);

    @RequestMapping(value = "/edit" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean update(@RequestBody SysMenuVo menu);

    @RequestMapping(value = "/delete/{menuId}" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean delete(@PathVariable(value = "menuId") Long menuId);


    @RequestMapping(value = "/deleteBatch" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean deleteBatch(@RequestBody List<Long> menuIds);

    @RequestMapping(value = "/query/{menuId}" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public SysMenuDto query(@PathVariable(value = "menuId") Long menuId);

    @RequestMapping(value = "/query/list" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public List<SysMenuDto> queryList(@RequestBody SysMenuVo vo);

    @RequestMapping(value = "/query/menuTree" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public List<SysMenuDto> tree(@RequestBody SysMenuVo vo);

    @RequestMapping(value = "/query/menuButtonTree" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public List<SysMenuDto> menuButtonTree(@RequestBody SysMenuVo vo);

    @RequestMapping(value = "/uniquenessCheck", method = RequestMethod.GET)
    public boolean uniquenessCheck(@RequestParam("permission") String permission, @RequestParam(value = "id",required=false) Long id);


}
